<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%  
response.setHeader("Access-Control-Allow-Origin", "*");  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer" />
<title>主板公司·数据工厂</title>
<link href="${pageContext.request.contextPath }/img/webLogoIcon.png"
	rel="shortcut icon">
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/font-awesome.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/animate.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/style.css"
	rel="stylesheet">
<!-- FooTable -->
<link href="${pageContext.request.contextPath }/css/footable.core.css"
	rel="stylesheet">
<link
	href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/mypage.css"
	rel="stylesheet">
<style>
.select2_demo_1 {
	float: left;
	width: 120px;
	display: inline;
	margin-left: 10px;
}

.form-control {
	display: inline;
}

.col-sm-3 {
	float: right;
	width: 560px;
}

.input-group {
	float: right;
	width: 240px;
	margin-left: 5px;
}

td {
	vertical-align: middle;
}

.b {
	background-color: #f5f5f6;
}

.table1, .table1 tr th, .table1 tr td {
	border: 1px solid #E7EAEC;
	padding: 8px;
}

.source {
	display: inline-block;
	cursor: pointer;
	margin-bottom: 10px;
	padding: 5px 5px;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-right: 20px;
}

.sourceAct {
	border-color: #f8ac59;
	color: #f8ac59;
}

.webAct {
	border-color: #f8ac59 !important;
	color: #f8ac59;
}

.web {
	display: inline-block;
	cursor: pointer;
	margin-bottom: 10px;
	padding: 5px 5px;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-right: 20px;
}

caption {
	padding: 0 0 !important;
}
</style>
</head>
<body>
	<div id="wrapper">
		<nav class="navbar-default navbar-static-side" role="navigation">
		<%request.setAttribute("LEFT", "motherboard-company");%> <%@include
			file="../components/left.jsp"%> </nav>
		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom">
				<jsp:include page="../components/head.jsp" flush="true" />
			</div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-9">
					<h2>主板公司</h2>
					<ol class="breadcrumb">
						<li class="nav-main1"><a
							href="${pageContext.request.contextPath}/admin/tosystem_overview">主页</a>
						</li>
						<li class="nav-main2"><a id="navigation1" href="#">证券数据</a></li>
						<li class="active"><a>主板公司</a></li>
					</ol>
				</div>
			</div>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-lg-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">
								<div class="row m-t-sm">
									<div class="col-lg-12">
										<div class="panel blank-panel">
											<div class="panel-body">
												<div class="tab-content">
													<div class="tab-pane active" id="tab-1">
														<div class="feed-activity-list" id="list"></div>

													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<jsp:include page="../components/footer.jsp" flush="true" />
		</div>
	</div>
	<!-- Mainly scripts -->
	<script src="${pageContext.request.contextPath }/js/jquery-2.1.1.js"></script>
	<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/jquery.metisMenu.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/jquery.slimscroll.min.js"></script>
	<!-- Custom and plugin javascript -->
	<script src="${pageContext.request.contextPath }/js/inspinia.js"></script>
	<script src="${pageContext.request.contextPath }/js/pace.min.js"></script>
	<!-- FooTable -->
	<script
		src="${pageContext.request.contextPath }/js/footable.all.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/mypage.js"></script>
	<!-- Page-Level Scripts -->
	<script>
        $(document).ready(function() {
            $('.footable').footable();
        });
        <% 
	        String article_public_id = (String)request.getParameter("article_public_id");
	      %>
	      var article_public_id = '<%=article_public_id%>'
        
        $(function(){
        	carlist()
		});
        
		function carlist(){
        	$.ajax({
        		url : "${pageContext.request.contextPath}/motherboardCompany/detail",
        		type : "post",
        		data:{
        			article_public_id: article_public_id,
        		},
        		success: function(res1) {
        			let res = JSON.parse(res1);
        			let detail=JSON.parse(res.otherdetail);
        			let res2=detail.jbzl;
        			var h='<h3 style="margin: 15px 0 10px 0;color:black;">公司介绍</h3><table cellpadding="0" cellspacing="0" width="100%" id="companyIntro" class="table1">'+
           				'<tbody>'+
   					'<tr>'+
   						'<td width="180px" class="b">机构全称</td>'+
   						'<td><span title="${stock.INSTNAME }">'+res.full_name+'</span></td>'+
   						'<td class="b">英文全称</td> '+
   						'<td><span title="${stock.FENNAME }">'+res.english_name+'</span></td>'+
   						'</tr> '+
   					'<tr>'+
   						'<td class="b">成立日期</td> '+
   						'<td>'+res.builddate+'</td> '+
   						'<td class="b">总市值</td> '+
   						'<td exportdatatype="N|2|T">'+res.totalMarket+'</td>'+
   					'</tr> '+
   					'<tr>'+
   						'<td class="b">上市日期</td> '+
   						'<td>'+res.listdate+'</td> '+
   						'<td class="b">证监会行业</td> '+
   						'<td>'+res.zjhindustry+'</td>'+
   					'</tr> '+
   					
   					'<tr>'+
						'<td class="b">法定代表人</td> '+
						'<td>'+res2.frdb+'</td> '+
						'<td class="b">董事长</td> '+
						'<td>'+res2.dsz+'</td>'+
					'</tr> '+
					'<tr>'+
					'<td class="b">总经理</td> '+
					'<td>'+res2.zjl+'</td> '+
					'<td class="b">董事秘书</td> '+
					'<td>'+res2.dm+'</td>'+
				'</tr> '+
				'<tr>'+
				'<td class="b">联系电话</td> '+
				'<td>'+res2.lxdh+'</td> '+
				'<td class="b">信息披露人</td> '+
				'<td>'+res2.dm+'</td>'+
			'</tr> '+
			'<tr>'+
			'<td class="b">邮政编码</td> '+
			'<td>'+res2.yzbm+'</td> '+
			'<td class="b">公司电子邮箱</td> '+
			'<td>'+res2.dzxx+'</td>'+
		'</tr> '+
		'<tr>'+
		'<td class="b">营业执照号码</td> '+
		'<td>'+res2.gsdj+'</td> '+
		'<td class="b">律师事务所</td> '+
		'<td>'+res2.lssws+'</td>'+
	'</tr> '+
   					
   					'<tr>'+
   						'<td class="b">注册地址</td>'+
   						'<td><span title="">'+res2.zcdz+'</span></td> '+
   						'<td class="b">办公地址</td> '+
   						'<c:set var="contentstr" value="${stock.OFFICEADDRESS }"/>'+
						'<c:set var="OFFICEADDRESS" value="${fn:substring(contentstr, 0, 20)}" />'+
   						'<td><span title="">'+res2.bgdz+'</span></td>'+
   						'</tr> '+
   					'<tr>'+
   						'<td class="b">公司网址</td> '+
   						'<td><a href="http://'+res.website+'" target="_black" >'+res.website+'</a></td>'+ 
   						'<td class="b">职工总数</td> '+
   						'<td exportdatatype="N||">'+res.employeenum+'</td>'+
   					'</tr> '+
   					'<tr>'+
						'<td class="b">公司简介</td> '+
						'<td colspan="3" class="wsn"><span title="">'+res2.gsjj+'</span></td>'+
					'</tr> '+
   					'<tr>'+
   						'<td class="b">主要产品</td> '+
   						'<td colspan="3" class="wsn"><span title="">'+res.product+'</span></td>'+
   					'</tr> '+
   					'<tr>'+
   						'<td class="b">对应模块</td> '+
   						'<td colspan="3" class="wsn"><span title="">'+res.boards+'</span></td>'+
   					'</tr> '+
   					'<tr>'+
   						'<td class="b">经营范围</td> '+
   						'<td colspan="3" class="wsn"><span title="">'+res2.jyfw+'</span></td>'+
   					'</tr> '+
   				'</tbody>'+
   			'</table>';
					var html = '<div class="feed-element">'+
					                '<div class="search-result">'+
				                       	'<div>'+
					                   		'<h2>'+
					                   			'<a href="#">'+res.simple_name+'</a>'+
					                   		'</h2>'+
					                   		h+
					                   	'</div>'+
				                   '</div>'+
				                   '<div class="search-result" style="border-top: 1px solid #e5e6e7;">'+
				                   	   '<h3 style="margin: 10px 0 10px 0;color:black;">主营构成</h3>'+
					                   '<div class="search-result" id="jyps" style="margin: 0 0 0 10px;">'+
					                   		'<h4 style="margin: 10px 0 10px 0;color:black;">经营评述</h4>'+
				                   		'</div>'+
						                '<div class="search-result" id="zygcfx" style="margin: 0 0 0 10px;border-top: 1px solid #e5e6e7;">'+
				                   			'<h4 style="margin: 20px 0 10px 0;color:black;">主营构成方向</h4>'+
				                   		'</div>'+
						                '<div class="search-result" id="zyfw" style="margin: 0 0 0 10px;border-top: 1px solid #e5e6e7;">'+
				                   			'<h4 style="margin: 20px 0 10px 0;color:black;">主营范围</h4>'+
				                   		'</div>'+
			                   		'</div>'+
				                   '<div class="search-result" style="border-top: 1px solid #e5e6e7;">'+
				                   		'<h3 style="margin: 20px 0 10px 0;color:black;">公司高管</h3>'+
					                   	'<table class="table table-bordered">'+
			                           		'<thead>'+
			                               		'<tr>'+
			                               			'<th>序号</th>'+
			                               			'<th>姓名</th>'+
			                               			'<th>性别</th>'+
			                               			'<th>年龄</th>'+
			                               			'<th>学历</th>'+
			                               			'<th>职位</th>'+
											  	'</tr>'+
			                           		'</thead>'+
			                           		'<tbody id="table">'+
			                                
			                           		'</tbody>'+
										'</table>'+
				                   '</div>'+
				               '</div>';
				    $('#list').html(html);
				    
				    var constitute = JSON.parse(res.constitute);
				    var jyps = constitute.jyps;
				    for (var i = 0; i < jyps.length; i++) {
				    	var ms = jyps[i].ms;
				    	if (ms && ms.length > 100) {
				    		 ms =  ms.substring(0, 100) + '......';
						}
						var html = '<p>'+
				       					'<span style="margin-right: 30px;">股票代码: '+jyps[i].gpdm+'</span>'+
				       					'<span style="margin-right: 30px;">日期: '+jyps[i].rq+'</span>'+
				               		'</p>'+
				               		'<p>'+
				               			'<span style="margin-right: 30px;">描述: '+ms+'</span>'+
				               		'</p>';
				         $('#jyps').append(html);
					}
				    
				    var zygcfx = constitute.zygcfx;
				    for (var i = 0; i < zygcfx.length; i++) {
// 				    	zygc 主营构成   lrbl利润比例 dw单位 zysr主营收入 zycb主营成本   cbbl成本比例  srbl收入比例 zylr主营利润  
						var rq = zygcfx[i].rq;
						var hy = zygcfx[i].hy;
						var qy = zygcfx[i].qy;
						var cp = zygcfx[i].cp;
						var html = '<div>'+
									'<h5>'+rq+'</h5>'+
										'<div style="margin-left:20px;">'+
										totable(hy, '行业') +
										totable(qy, '企业') +
										totable(cp, '产品') +
										'</div>'+
									'</div>';
						$('#zygcfx').append(html)
					}
				    
				    var zyfw = constitute.zyfw;
				    for (var i = 0; i < zyfw.length; i++) {
				    	var ms = zyfw[i].ms;
				    	if (ms && ms.length > 100) {
				    		 ms =  ms.substring(0, 100) + '......';
						}
						var html = '<p>'+
				               			'<span style="margin-right: 30px;">描述: '+ms+'</span>'+
				               		'</p>';
				        $('#zyfw').append(html);
					}
				     
				    var executives = JSON.parse(res.executives);
				    var list = executives.list;
				    for (var i = 0; i < list.length; i++) {
				    	var html = '<tr>'+
				               			'<td>'+(i+1)+'</td>'+
				               			'<td>'+list[i].name+'</td>'+
				               			'<td>'+list[i].sax+'</td>'+
				               			'<td>'+list[i].age+'</td>'+
				               			'<td>'+list[i].edu+'</td>'+
				               			'<td>'+list[i].position+'</td>'+
								  	'</tr>';
						$('#table').append(html);
					}
        		},
        		error: function(err) {
        			console.log(err)
        		}
        	});
        }
		
		function totable(obj, name) {
//		    	zygc 主营构成   lrbl利润比例 dw单位 zysr主营收入 zycb主营成本   cbbl成本比例  srbl收入比例 zylr主营利润  
			var html = '';
			for (var j = 0; j < obj.length; j++) {
				html += '<tr>'+
       						'<td>'+(j+1)+'</td>'+
			       			'<td>'+obj[j].zygc+' </td>'+
			       			'<td>'+obj[j].lrbl+'</td>'+
			       			'<td>'+obj[j].dw+'</td>'+
			       			'<td>'+obj[j].zysr+'</td>'+
			       			'<td>'+obj[j].zycb+'</td>'+
			       			'<td>'+obj[j].cbbl+'</td>'+
			       			'<td>'+obj[j].srbl+'</td>'+
			       			'<td>'+obj[j].zylr+'</td>'+
					  	'</tr>'
			}
			var html1 = '<table class="table table-bordered">'+
							'<caption>'+name+'</caption>'+
				       		'<thead>'+
				           		'<tr>'+
				           			'<th>序号</th>'+
				           			'<th>主营构成 </th>'+
				           			'<th>利润比例</th>'+
				           			'<th>单位</th>'+
				           			'<th>主营收入</th>'+
				           			'<th>主营成本</th>'+
				           			'<th>成本比例</th>'+
				           			'<th>收入比例</th>'+
				           			'<th>主营利润</th>'+
							  	'</tr>'+
				       		'</thead>'+
				       		'<tbody>'+
				       		html+
				       		'</tbody>'+
						'</table>';
			return html1;
		}
		
		//跑马灯方法 
// 		 function init(){
// 			    //获取标题
// 			    var title=document.title;
// 			    //分割字符串--->字符数组
// 			    var arr=title.split("");
// 			    //删除第一个元素并返回该元素
// 			    var e=arr.shift();
// 			    //把一个对象添加到数组末尾
// 			    arr.push(e);
// 			    //把数组转换成字符串
// 			    var marquee=arr.join("");
// 			    //返回给浏览器
// 			    document.title=marquee;
// 			    //定时一直执行
// 			    window.setTimeout("init()",1000);
// 			}
// 			window.onload=init;
    </script>
	<script
		src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
</body>
</html>
